/**
 * ProductBO.java
 * Created on March 21, 2007, 6:10 PM
 *
 *
 */

package edu.byu.isys413.jjenkins.data;

/**
 * This abstract class is extended by all revenue sources subclasses. This
 * class will be developed futher as we program the revenue source subclasses
 * and find out what else it needs.
 *
 * @author      Josh
 * @version     1.0
 */

public abstract class ProductBO extends BusinessObject{// extends SaleBO {  I don't know why you had this extending saleBO, but it was messing up 
                                                    //my batch processing.  I hope this doesn't mess up your code.
    
    
    /** Creates a new instance of ProductBO */
    public ProductBO() {
    }
       
    /**
     * price of the product
     */
    private double price = 0;
    
    /**
     * the method gets the price
     * @return price of revenue source
     */
    public double getPrice() {
        if(price==0){
            try {
                setPrice(SaleDAO.getInstance().readProductPrice(id));
            } catch (DataException ex) {
                ex.printStackTrace();
            }
        }
        return price;
    }

    /**
     * this method sets the price
     * @param price price of revenue source
     */
    public void setPrice(double price) {
        this.price = price;
    }
    
}